package third;

import java.util.Scanner;
import java.lang.String;

public class five_36 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int m=0;
        String a=input.next();

        for(int i=1;i<=9;i++){
            System.out.print(a.charAt(i-1));
            m+=i*((int)(a.charAt(i-1))-48);
        }
        m=m%11;
        if(m==10)
            System.out.print("X");
        else
            System.out.println(m);


    }
}
